package com.zx.mes.hyl.test.base.impl;

import com.alibaba.fastjson.JSON;
import com.zx.mes.hyl.test.base.FangWuI;
import org.apache.log4j.Logger;

/**
 * 继承FangWuI接口，实现通用方法
 * @author hyl
 * @date 2018-2-26
 */
public abstract class AbstractFangWu implements FangWuI{

    private static final Logger logger = Logger.getLogger(AbstractFangWu.class);

    @Override
    public void beforeFangWu(String str) {
        logger.info(JSON.toJSONStringWithDateFormat("防务之前要做的事(点位及其它的必要条件检查)","yyyy-MM-dd HH:mm:ss"));
    }

    @Override
    public void afterFangwu(String str) {
        logger.info(JSON.toJSONStringWithDateFormat("防务做完之后要做的事","yyyy-MM-dd HH:mm:ss"));
    }

    /**
     * 模板方法
     * @param fangWu
     */
    public void templetFangWu(AbstractFangWu fangWu){
        fangWu.beforeFangWu("");
        fangWu.doFangWu("");
        fangWu.afterFangwu("");
    }
}
